package main

import (
	"LogisticsPort/service"
	"LogisticsPort/service/bank"
	"LogisticsPort/service/inventory"
	"LogisticsPort/service/market"
	"LogisticsPort/service/product"
	_ "LogisticsPort/service/purchase"
	purchase2 "LogisticsPort/service/purchase"
	"LogisticsPort/service/sales"
	"LogisticsPort/service/yw"
	"LogisticsPort/sql"
	"fmt"
	"github.com/gin-gonic/gin"
)

func main() {
	/*http.HandleFunc("/", wx.Get)
	http.ListenAndServe(":80", nil)*/

	/*r := gin.Default()
	r.GET("/", wx.CheckSignature)
	r.Run(":80")*/

	//
	r := gin.Default()
	purchase2.Purchase(r)
	service.FileHandle(r)
	sales.Sales(r)
	service.Car(r)
	service.Customer(r)
	bank.Bank(r)
	service.User(r)
	service.File(r)
	market.Market(r)
	inventory.Inventory(r)
	product.Product(r)
	yw.YW(r)
	seller := r.Group("/seller")
	{
		seller.GET("list", service.SellerList)
	}

	//采购信息
	purchase := r.Group("/purchase")
	{
		product := purchase.Group("/product")
		{
			product.GET("/clearance/update", service.PurchaseClearanceUpdate)
		}

		clearance := purchase.Group("/clearance") //清关费用
		{

			clearance.GET("/field/list", service.ClearanceFieldList) //清关费用专用字段
		}
	}

	customer := r.Group("/customer")
	{
		customer.GET("/list", service.CustomerList)
		customer.GET("/detail", service.CustomerDetail)
		customer.GET("/delete", service.CustomerDelete)
	}

	//r.GET("/:upload/:folder/:image", sql.ShowImage)
	r.GET("/upload/:module/:folder/*image", sql.ThirdLevelDirectory)

	err := r.Run(":8081")
	if err != nil {
		fmt.Println("ListenerAndServe error:", err.Error())
	}
	//service.BC()
}
